using Autofac;
using PowerManage.Repository;

namespace PowerManage.API.Extensions;

/// <summary>
/// 模块注册
/// </summary>
public class AutofacModuleRegister : Module
{
    /// <summary>
    /// 加载
    /// </summary>
    /// <param name="builder"></param>
    protected override void Load(ContainerBuilder builder)
    {
        // 注册仓储
        builder.RegisterGeneric(typeof(BaseRepository<>)).As(typeof(IBaseRepository<>)).InstancePerLifetimeScope();
    }
}